﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Model;
using BLL;

namespace EstateappraisalApi.Controllers
{
    /// <summary>
    /// 勘察
    /// </summary>
    public class SurveyController : ApiController
    {
        Basic_InfoBLL bll = new Basic_InfoBLL();
        Loan_InfoBLL lbll = new Loan_InfoBLL();


        // GET api/survey
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/survey/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/survey
        public void Post([FromBody]string value)
        {
        }

        // PUT api/survey/5
        /// <summary>
        /// 修改项目状态为结束勘察
        /// </summary>
        /// <param name="basic_id"></param>
        /// <param name="basic_State"></param>
        /// <returns></returns>
        public int Put([FromBody]Basic_Info m)
        {
            m.survey_EndTime = DateTime.Now.ToString();
            if (bll.UptBasic_Info(m.basic_id, m.basic_State, m.survey_EndTime))
            {
                return 1;
            }
            else
            {
                return 0;
            }

        }

        // DELETE api/survey/5
        public void Delete(int id)
        {
        }
    }
}
